package lab02.test11;

/**
 * Created by 阿阿阿阿豪丶 on 2017/10/25.
 */
public class Square extends Rectangle implements Printx {

    Square(double length, double width) {
        super(length, width);
    }

    public double diagonal() {
        double diagonal = length * Math.sqrt(3);
        return diagonal;
    }

    @Override
    public void printMyWay() {
        System.out.println("正方形边长为：" + length + "  面积为：" + area(5, 5) + "  周长为:" + primeter(5, 5) + "  对角线长：" + diagonal());
    }
}
